import type { User } from '@/types/user'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUserStore = defineStore('user', () => {
    const user = ref<User>()
    const openid=ref("")

    const setUser=(u:User)=>{
        u.openid='oddnc6o1-QTEm1VSqfHqmheexFPY'
        user.value=u;
    }
    
    function getOpenid() {
        //获取openid
        //?.openid=''
    }
    return {
        user,
        getOpenid,
        setUser
    }
}, {
    persist: true
})
